package com.sdkj.dspservice.modules.report.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sdkj.dspservice.common.base.service.impl.CrudServiceImpl;
import com.sdkj.dspservice.modules.report.dao.TableConfigColumnDao;
import com.sdkj.dspservice.modules.report.entity.TableConfigColumn;
import com.sdkj.dspservice.modules.report.service.TableConfigColumnService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 表字段配置service实现类
 * @author tm
 */
@Slf4j
@Service
@Transactional(readOnly = true)
public class TableConfigColumnServiceImpl extends CrudServiceImpl<TableConfigColumnDao, TableConfigColumn> implements TableConfigColumnService {

    /**
     * 获取不显示的ID列表
     * @param tableConfigId
     * @return
     */
    @Override
    public List<String> findIsNotShowIdList(String tableConfigId) {
        return dao.findIsNotShowIdList(tableConfigId);
    }

    @Override
    public List<TableConfigColumn> list(TableConfigColumn tableConfigColumn) {
        return list(new QueryWrapper<>(tableConfigColumn));
    }

    @Override
    public List<TableConfigColumn> list(Wrapper<TableConfigColumn> queryWrapper) {
        ((QueryWrapper) queryWrapper).orderByAsc("sort");
        return super.list(queryWrapper);
    }

}

